//
//  HWLevelViewController.m
//  嗨文
//
//  Created by 响当当 on 2019/2/19.
//  Copyright © 2019年 dongzheng. All rights reserved.
//

#import "HWLevelViewController.h"
#import "HWLevelView.h"

@interface HWLevelViewController ()
@property (nonatomic, strong)HWLevelView *levelView;
@end

@implementation HWLevelViewController

- (HWLevelView *)levelView
{
    if (!_levelView)
    {
        _levelView = [[HWLevelView alloc]initWithFrame:CGRectMake(0,NAVIBAR_HEIGHT,SCREEN_WIDTH,SCREEN_HEIGHT-NAVIBAR_HEIGHT)];
    }
    return _levelView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setTitle:@"排行榜"];
    [self setDefaultNav];
    [self getInfor];
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self.view addSubview:self.levelView];
}

#pragma mark - 获取我的钱包信息数据
- (void)getInfor
{
    
    NSDictionary *prarmers = @{
                               @"access_token" : current_User.token,
                               @"pageSize" : @"10"
                               };
    
    WeakSelf(self)
    [MyInfoManager getLevelList:prarmers sucess:^(id  _Nonnull acceptData) {
        DISMISS_SVP(1.0f);
        [weakSelf.levelView getInfo:acceptData];
    } fail:^(NSError * _Nullable error) {
        DISMISS_SVP(1.0f);
        [SVProgressHUD showErrorWithStatus:@"获取我的钱包信息失败，请检查网络是否良好"];
        DISMISS_SVP(1.0f);
    }];
}

@end
